/*jshint node:true*/
/* global require, module */
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var Funnel = require('broccoli-funnel');
var mergeTrees = require("broccoli-merge-trees");

module.exports = function(defaults) {
  var app = new EmberApp(defaults, {
    'ember-cli-bootstrap-datetimepicker': {
      icons: {
        date: 'glyphicon glyphicon-calendar',
      }
    },
    fingerprint: {
      enabled: false,//取消打包时的随机版本号
    },
    outputPaths: {
      app: {
        html: 'index.html',
        css: {
          'app': '/assets/styles/app.css'
        }
      }
    },
    lessOptions: {
      paths: [
        'app/styles'
      ]
    },
    //解决cssfilterclean的broken的问题
    minifyCSS: {
      options: {
        processImport: false
      }
    },
  });
  var faAssets = new Funnel("app/styles/fonts", {
    srcDir: "/",
    include: ["fontawesome/*.*","linecons/*.*","elusive/*.*","bootstrap/*.*"],
    destDir: "/assets/styles/fonts"
  });
  app.import('bower_components/bootstrap-datepicker/js/locales/bootstrap-datepicker.zh-CN.js');
  app.import('bower_components/jquery-md5/jquery.md5.js');
  app.import('bower_components/mobile-detect/mobile-detect.js');
  app.import('bower_components/operative/dist/operative.js');
  app.import('bower_components/bootstrap/dist/js/bootstrap.js');
  app.import('bower_components/lmx-jsonpath/index.js');
  app.import('bower_components/lmx-jsonpath/pinyin_dict_firstletter.js');
  app.import('bower_components/lmx-jsonpath/pinyinUtil.js');
  app.import('bower_components/lmx-jsonpath/jquery.base64.js');
  app.import('bower_components/xenon/js/TweenMax.min.js');
  app.import('bower_components/xenon/js/resizeable.js');
  app.import('bower_components/xenon/js/joinable.js');
  app.import('bower_components/xenon/js/xenon-api.js');
  app.import('bower_components/xenon/js/moment.min.js');
  app.import('bower_components/moment-duration-format/lib/moment-duration-format.js');
  app.import('bower_components/xenon/js/init.js');
  app.import('bower_components/iscroll/build/iscroll-infinite.js');
  app.import('bower_components/jquery-qrcode/jquery.qrcode.min.js');
  app.import('bower_components/js-cookie/src/js.cookie.js');
  app.import('bower_components/hammer.js/hammer.js');
  app.import('bower_components/jquery-hammerjs/jquery.hammer.js');
  app.import('bower_components/jquery-ui/jquery-ui.js');
  app.import('bower_components/weixin/jweixin-1.0.0.js');
  app.import('bower_components/cropit/dist/jquery.cropit.js');
  var assets = mergeTrees([faAssets]);
  return app.toTree(assets);
};
